var app = angular.module('app');

app.factory('clockService', [function () {
    var clockService = {};

    clockService.string2Date = function (string) {
        var timeArray = string.split(':');
        var hour = parseInt(timeArray[0]);
        var minute = parseInt(timeArray[1]);

        return new Date(0, 0, 0, hour, minute);
    };
    return clockService;
}]);